//
// Created by yanhai on 2021/11/4.
//

#pragma once

#include <mutex>

struct Flow {

    unsigned int src_addr{0};
    unsigned int dst_addr{0};

    unsigned short src_port{0};
    unsigned short dst_port{0};

    unsigned int proto{0};

    unsigned int count{0};

    // 必须的成员
    Flow *next;
    std::mutex mutex;

    bool operator==(const Packet &p) const;
};


Flow *FlowGetNew();
void FlowInit(Flow *f, const Packet *p);

